using System.Collections;
using System.Collections.Generic;
using UnityEngine;


namespace Unity.Per.Common.UIFrameWork
{
    public class SimpleUIEntry :BaseEntery
    {
        [SerializeField]
        private Canvas m_rootCanvas;
        public Canvas rootCanvas {
            get {
                if ( m_rootCanvas == null ) {
                    m_rootCanvas = new GameObject("RootCanvas").AddComponent<Canvas>();
                    m_rootCanvas.transform.parent = transform;
                }
                return m_rootCanvas;
            }
        }

        public override void AddBaseWindowSlot(BaseWindowSlot baseWindowSlot) {
            base.AddBaseWindowSlot(baseWindowSlot);
            if ( baseWindowSlot.BindWindowRegion == null ) {
                baseWindowSlot.transform.parent = rootCanvas.transform;
            }
        }
    }
}
